package edu.cuit.avatar.decorator;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/7/5 11:12
 */
public class DecorationDemo {
    public static void main(String[] args) {
        System.out.printf("byte:%d -- %d\r\n", Byte.MIN_VALUE, Byte.MAX_VALUE);
        System.out.printf("short:%d -- %d\r\n", Short.MIN_VALUE, Short.MAX_VALUE);
        System.out.printf("int:%d -- %d\r\n", Integer.MIN_VALUE, Integer.MAX_VALUE);
        System.out.printf("long:%d -- %d\r\n", Long.MIN_VALUE, Long.MAX_VALUE);
        System.out.printf("float:%f -- %f\r\n", Float.MIN_VALUE, Float.MAX_VALUE);
        System.out.printf("double:%f -- %f\r\n", Double.MIN_VALUE, Double.MAX_VALUE);

        System.out.println("==========================================================");
        //创建数值型的引用类型
        Integer number = Integer.valueOf(100);
        Double number2 = Double.valueOf(3.14);

        System.out.println(number.intValue());
        System.out.println(number.byteValue());
        System.out.println(number.doubleValue());
        System.out.println(number2.doubleValue()); //返回基本数据类型值

        Boolean b = Boolean.valueOf(true);
        //自动装箱(将基本数据类型转为包装类型)
        Integer number3 = 100;
        System.out.println(number3.intValue());

        //自动拆箱(将包装类型转为基本类型)
        int result = number3 * 20;
        System.out.println(result);


        String s = "100";
        Integer.parseInt(s);
        System.out.println(Integer.parseInt("010101101", 2));

        String s1 = "false";
        Boolean.parseBoolean(s1);

    }
}
